<?
class SuccessForm extends Form{
	function SuccessForm(){
		Form::Form('success');
		$this->link_css('style/personal.css');	
		$this->link_js('javascript/jquery/packed/jquery.jeditable.js');
	}
	
	function draw(){
		global $display;
		
		$display->add('get_cmd',Url::get('cmd'));					
		$display->add('get_action',Url::get('action'));
		$display->add('get_page',Url::get('page'));	
		
	    echo '<script language="javascript">
	    		var url_root = "'.WEB_ROOT.'"
	    	  </script>';

		$display->add('get_page',  ECore::$page['name']);
		$display->add('get_cmd',   Url::get('cmd'));
		$display->add('user_name', User::user_name());
		
		$display->add('can_edit_blast',((User::is_admin()) || !User::is_block()));
		$blast			= User::$current->data['blast'];
		$avatar_link 	= '';
		$avatar_url 	= 'style/images/no_avatar_item.gif';
			
		if(User::$current->data['avatar_url'] != ''){
			$avatar_link 	= "http://".CGlobal::$img_server[User::$current->data['img_server']].User::$current->data['avatar_url'];
			$avatar_url 	= ECLib::getImageThumb(User::$current->data['avatar_url'],80,80,0,User::$current->data['img_server']);
		}
		
		if($blast == ''){
			$blast = '...';
		}
		else{
			$blast = ' '.$blast;
			if(strpos($blast,'http://')){
				$user_blast = $blast;
				while(strpos($user_blast,'http://')){
					$tmp = substr($user_blast,strpos($user_blast,'http://'));
					
					if(strpos($tmp,' ') || strpos($tmp,'<')){
						if(strpos($tmp,' ') && strpos($tmp,'<') && (strpos($tmp,' ') > strpos($tmp,'<'))){
							$blast_url = substr($tmp,0,strpos($tmp,'<'));
						}
						else{
							$blast_url = substr($tmp,0,strpos($tmp,' '));
						}
					}
					else{
						$blast_url = $tmp;
					}
					$user_blast = str_replace($blast_url,'',$user_blast);
				}
				$new_blast_url = ' <a rel="nofollow" href="'.$blast_url.'" target="_blank">Click here</a>';
				$blast = substr($user_blast.$new_blast_url,1);
			}
		}
		
		$display->add('avatar_link',$avatar_link);
		$display->add('avatar_url',$avatar_url);
		$display->add('blast',$blast);
		$display->add('user_id',User::id());
			
		$TopMenu = $display->output('TopMenu',true,'Personal');
		$display->add('TopMenu',$TopMenu);
	    
	    $display->output('success',false,'Personal');
	}
}
?>
